package org.example.myleet.rosalind.dna;

public class Solution {

    public int[] countDnaNucleotides(String dna) {
        int[] acgt = new int[4];
        char c;
        for (int i = 0; i < dna.length(); ++i) {
            c = dna.charAt(i);
            if (c == 'A') {
                ++acgt[0];
            } else if (c == 'C') {
                ++acgt[1];
            } else if (c == 'G') {
                ++acgt[2];
            } else if (c == 'T') {
                ++acgt[3];
            }
        }
        return acgt;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] acgt = solution.countDnaNucleotides("GCAGGGCCACAGCGTTCTGATCCCTACGGCGTAACCGACTCGTTTAAGAAGCTTAATTCCGGTACTGAAGATGACGACGACGAAGTTACAGTGCATTGCTAATTAGACATATTGAGGGCCCGGTCGCCAGTGCAAACCATTCATATCCTCCATCGGCTGGGTCGAACAGTATATTTGAGAGCTAAGTCCTTTCCTATGTCCGTTGCCCGCCACACTGACAACATTTATCCAAAGGATCTTACAGATAAGCCAGTAAGATTACTGCCCAACACGATGGCTATCTCTCTCAGCAACGAACGTATTGCAGCACTTATATTCTATATTGTACATCACGTTTTCTGTGAGATGCAATTCTTGGATACCGCACACTTGTCGTACACTTCCCCCTTGTCTGAAAGTAGTGTCGATGGACCGTATTAAAGAAATACGACGGGAAAGTCAGCGTAATGTTCCAACAAACGTGCCACGCAGCTTTGTGAGCTTGCTAGGGGACCAGACATAGATGATCAAGCAGTCGAGCCAGAGCTATGATAATCGGTCTCCTAAACACTCTTAGTCAACCTTGGCAGCATGGGACTGTTATGCAGGGACGTTGTCTTGATGCAGGAAGAGACAAGATCCTGTCTACATACTGTAAATAAGGTTGTCACTTACGGACAACTCCATTTTTAAATAAATTACAACTCTATCGTTTGCTATGTGCCGTAATTTGGATTGTTCGCACAGGAACGATATTCGTAAGAAGTTATCTATCGTCGATCGATTCGGGACTGGCGTGCGATCGATGGCTAAACTTATTGGTAATCCTAAGGCCCCGTCGGCCAACAGTCTGGGGGAGATCTCCATTAGACGACCTAGACCGTTTGCTTGCAGTTCATTTGTTACTGGGTGAAAGTGGCTAAAAGAAACATTCACGAAAGAGGGGCGTCCTGTTCGCCTGGAGTTGGGGCAGACAGAG");
        System.out.printf("%d %d %d %d\n", acgt[0], acgt[1], acgt[2], acgt[3]);
    }
}
